<template>
	<view>
		<button @click="callSetStorage()">setStorage</button>
		<button @click="callGetStorage()">console.debug</button>
		<button @click="callStoInfo()">console.info</button>
		<button @click="callRemove()" type="warn">removeStorage</button>
		<button @click="callClear()" type="warn">clearStorage</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
		
				callSetStorage(){
					console.log("callSetStorage--> userName");
					uni.setStorage({
						key:"userName",
						data:"weiyvyang",
						success(){
							console.log("存储uearname 成功回调");
						},
						fail(){
							console.error("存储userName 成功失败");
						},
						complete(){
							console.error("结算");
						},
					})
				},
				callGetStorage(){
					uni.getStorage({
						key:"userName",
						
						success:function(result){
							console.log("获取本地缓存成功"+result.data);
						},
						fail:function(e){
							console.error("获取本地缓存失败" + JSON.stringify(e));
							console.error("获取本地缓存失败" + e.errMsg);
						}
					})
				},
				callStoInfo(){
					console.log("callstion-->");
					uni.getSavedFileInfo({
						success:function(result){
							console.log("callstion-->" + result.keys);
							console.log("callstion-->" + JSON.stringify(resuit));
							
						}
					})
				},
				callRemove(){
				uni.removeStorage({
					key:"xinghui",
					success: () => {
						console.log("removeStorage success>");
					},
					fail: () => {
					console.log("removeStorage fail>");	
					}
				})	
				},
				callClear(){
					uni.clearStorage();
				},
			}
		}
	
</script>

<style>

</style>